#ifndef __SCORETABLE_H__
#define __SCORETABLE_H__

#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef _WIN32
	#include <windows.h>
#endif
#include <list>
#include <string.h>
#include <fstream>
#include <iostream>

#include "Score.h"

/*
 * Classe: ScoreTable
 *
 *   Tabela ordenada de scores
 *
*/

class ScoreTable
{
      private:
              std::list<Score> l;

      public:
             ScoreTable() {}
             ~ScoreTable() { clear(); }
             
             bool loadFromFile(const char * filename);
             void loadFromDefaults();
             bool saveToFile(const char * filename);
             
             bool isOnInterval(Score s) { return (l.back() < s); }
             void insertKeepSize(Score s);
             void insert(Score s);
             
             void sort() { l.sort(); l.reverse(); }
             void clear() { l.clear(); }
             
             void printAllFrom(float x, float y);
};

#endif
